home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 3: The Continuation / 17-Bit_The_Continuation_Disc.iso / amigan / amigan 10 / intuilib / screen.c < prev    next >
C/C++ Source or Header  |  1994-01-27  |  1KB  |  57 lines

  1. #include <graphics/gfxbase.h>
  2. #include <intuition/intuition.h>
  3.  
  4. struct IntuitionBase   *IntuitionBase;
  5. struct GfxBase         *GfxBase;
  6. struct Screen  *scr, *OpenScreen();
  7. struct RastPort *rp;
  8. struct ViewPort *vp;
  9. long GetMsg();
  10.  
  11. struct NewScreen scrdef = {
  12.    0, 0, 0, 0,
  13.    0,              /*  16 colors  */
  14.    0, 1,           /*  detail/block pens  */
  15.                /*  "Automatically" set up screen format  */
  16.    NULL,
  17.    CUSTOMSCREEN,
  18.    NULL, NULL, NULL, NULL  /* no special font, title, gadg, or bitmap */
  19. };
  20.  
  21. long screen (x,y,x1,y1,t,d)
  22. long x,y,x1,y1,d,t;
  23. {
  24. char *OpenLibrary();
  25. int q;
  26. q=0;
  27.  
  28. if ((t & 1)==1) q=HIRES;
  29. if ((t & 2)==2) q=(q | LACE);
  30. if ((t & 4)==4) q=(q | SPRITES);
  31. if ((t & 8)==8) q=(q | DUALPF);
  32. if ((t & 16)==16) q=(q | HAM);
  33.  
  34. scrdef.LeftEdge = x;
  35. scrdef.TopEdge =y;
  36. scrdef.Depth=d;
  37. scrdef.Width=x1;
  38. scrdef.Height=y1;
  39. scrdef.ViewModes = q;
  40.  
  41.    if (!(IntuitionBase = (struct IntuitionBase *)
  42.       OpenLibrary ("intuition.library", 1L))) {
  43.          exit (FALSE);
  44.    }
  45.  
  46.    if (!(GfxBase = (struct GfxBase *)
  47.       OpenLibrary ("graphics.library", 1L))) {
  48.          exit (FALSE);
  49.    }
  50.  
  51.    if (!(scr = OpenScreen (&scrdef))) {
  52.          exit (FALSE);
  53.    }
  54. return (scr);
  55. }
  56.  
  57.